UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GypBf9N6DTHRyEhlvmnlw6hc+iXsrezcu61FTniLUv8=' 
WHERE 
  key_id = '8d900fe4a5861dd1e35522f5dcbd645658d80bcf76db65cebf810e8a1257586c' 
  AND (
    token = 'GypBf9N6DTHRyEhlvmnlw6hc+iXsrezcu61FTniLUv8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030