UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E0YnUjqYPCdSy174O0YEZt1Fh5igHfkNPCdcJhc6QGQ=' 
WHERE 
  key_id = '7fe5ff77e0ff9c9c46f56cad7e9a7827c6a461f5ddcebeb8e8e9698a30f38704' 
  AND (
    token = 'E0YnUjqYPCdSy174O0YEZt1Fh5igHfkNPCdcJhc6QGQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031