UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GuqkPzusCXHwIU89EcbRLUVN9/i0L94HWLARyg5sGX0=' 
WHERE 
  key_id = '7ab0e506d7731edfba171e1936afdd9638d58805d6a9c42ad0cc9bfdbdc3c189' 
  AND (
    token = 'GuqkPzusCXHwIU89EcbRLUVN9/i0L94HWLARyg5sGX0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034