UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NSx4jcnOsM3oIjKwYf6cn7uCxoRGL8MND8R0d8tlA4o=' 
WHERE 
  key_id = '43ab25850e2f03ed6fbd7204b7c7b34026eb729bff3be0c082c578e7b8447798' 
  AND (
    token = 'NSx4jcnOsM3oIjKwYf6cn7uCxoRGL8MND8R0d8tlA4o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044