UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mvpbO8u0S0LgcXtUjS3vYlLmo4PzOVQjwpDRWWa5y4g=' 
WHERE 
  key_id = '85e49dd2ad18cc8fd13ab6021c2ea04a981aa6ec4a946235ab038b578f2094f3' 
  AND (
    token = 'mvpbO8u0S0LgcXtUjS3vYlLmo4PzOVQjwpDRWWa5y4g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029