UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QkP1K+pF645zWC467SqwAP/+H+ovViLYEGYebG5eLTs=' 
WHERE 
  key_id = '274be1a21e28599df15986f2c70810075643228a12737b88d9d7304a71e2f0af' 
  AND (
    token = 'QkP1K+pF645zWC467SqwAP/+H+ovViLYEGYebG5eLTs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031