UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/pfMv32MIIpDV7MBS0f0OTVFCboCByyXdIR4QKGdz9I=' 
WHERE 
  key_id = '9cc734e4464444649ed995233e26c5f04ec4046ab8a255cfe2a3639ed355723a' 
  AND (
    token = '/pfMv32MIIpDV7MBS0f0OTVFCboCByyXdIR4QKGdz9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017