UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lXriT36W3Pdt/3UYWPCq5Cj77e0A9DgmHPc3+FRRiHM=' 
WHERE 
  key_id = '819689a0c180aa203ead7a8ea4ab1b560096a8ebb6d2535f43e6b3436ce3e2ea' 
  AND (
    token = 'lXriT36W3Pdt/3UYWPCq5Cj77e0A9DgmHPc3+FRRiHM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016