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

Query time 0.00029