UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WyVUCx1q5HCr/8rbaQc4uPNgyCdNSJiDHJrYobsuGcQ=' 
WHERE 
  key_id = '9411077d91fb1cc8701dd94f475e3d5a16341091f2be387acce83a53b5f4de8e' 
  AND (
    token = 'WyVUCx1q5HCr/8rbaQc4uPNgyCdNSJiDHJrYobsuGcQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020