UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '72MrZMeRaGFP4Qkwp3gZcJaFCNj3QuXfXCZmK6vT118=' 
WHERE 
  key_id = '138c755f267f9c9d3761b0940f86e9cbbca9272fdfd3887cf65524cf97db5fac' 
  AND (
    token = '72MrZMeRaGFP4Qkwp3gZcJaFCNj3QuXfXCZmK6vT118=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030