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