UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6EXVjnQIs/aFMkfBzbuGOdjnLFhTHvTE3S6ktwmARXI=' 
WHERE 
  key_id = '9123cdec1ca8fb0883382979a4dae1329fa8d7339137a1c90828127ca2891310' 
  AND (
    token = '6EXVjnQIs/aFMkfBzbuGOdjnLFhTHvTE3S6ktwmARXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045