UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PSzOZixfTmnWnRxHGYTudiQ2hWZmucq5ft1rfYntTVA=' 
WHERE 
  key_id = 'b727c46f65329644b05c1c7a9d02a08312cdf916f68ef867b6d214e6f1ad2855' 
  AND (
    token = 'PSzOZixfTmnWnRxHGYTudiQ2hWZmucq5ft1rfYntTVA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044