UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '56KuItgKtrttkqSZRcv5BDSbltSX57+GUNr64qYV/VU=' 
WHERE 
  key_id = 'fccc45f2b972d60ab73683b5d40d14e4cee652085d6d8f12d67100ab2bfd172b' 
  AND (
    token = '56KuItgKtrttkqSZRcv5BDSbltSX57+GUNr64qYV/VU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036