UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '63EGxod97Y0lwtDyz2LZnPQx9CIjuMNUdmyqkUHrikg=' 
WHERE 
  key_id = 'c823f759680ee47b8b910aa969c8800c38dce39b7055a49744494dae09a9d5fd' 
  AND (
    token = '63EGxod97Y0lwtDyz2LZnPQx9CIjuMNUdmyqkUHrikg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027