UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IO/HZ0gCmdelDD5cQ/yCRS8ueLpqzxgsnkq97Y1pt7k=' 
WHERE 
  key_id = '8e31163e930e9ab348fdaa86cecd4e75993549b4cf9bd9e3b8cbcca6ca1fb63a' 
  AND (
    token = 'IO/HZ0gCmdelDD5cQ/yCRS8ueLpqzxgsnkq97Y1pt7k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041