UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UzKMy1Rf/3NdoP/sXLpK5Ig46C7oBOXwYBrwrKiRZ5o=' 
WHERE 
  key_id = 'd514998e6bb70d4245f39ee0ed32e59d5eb45aadb47755c043885ced0091c649' 
  AND (
    token = 'UzKMy1Rf/3NdoP/sXLpK5Ig46C7oBOXwYBrwrKiRZ5o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025