UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6y9rxhhUfwCRWIbvcddWmCzFtkotvtax72jaQXkURC8=' 
WHERE 
  key_id = '2e5cd89a8ad9bef37a26408f9005eedf045a44eeb3e02d9d535f38455b01b1ef' 
  AND (
    token = '6y9rxhhUfwCRWIbvcddWmCzFtkotvtax72jaQXkURC8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040