UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '47VGjuInnDfKJKK/fEw7oDImMyidZFAukwCCs7s/RYQ=' 
WHERE 
  key_id = 'c72299cf25b30b1d355099c89160a2d0c9ae4ab0fa6f55918f0d1b5622234dfb' 
  AND (
    token = '47VGjuInnDfKJKK/fEw7oDImMyidZFAukwCCs7s/RYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048