UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lxT/bDQB1ajmxagnEpnKvvQrxCPYWuVQlPOOlJ4Bpzs='
WHERE
key_id = 'd82d31c49cc59e299086616dd0c67a75af776324bd42ce1f90775ecaba84aa5c'
AND (
token = 'lxT/bDQB1ajmxagnEpnKvvQrxCPYWuVQlPOOlJ4Bpzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)