UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l/hUM+mti7dqfLcbryKMvhQoDuLsJQzPIugC5Abm3vI=' 
WHERE 
  key_id = '2a8aef6520f475782f007283e995e8e6d0bf8fff776b7c5fe3ea14a0f6f283f1' 
  AND (
    token = 'l/hUM+mti7dqfLcbryKMvhQoDuLsJQzPIugC5Abm3vI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027