UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8lV+Z5eknnDn8lffdiZOnMV5zwhczaVZbWFZmsl/zQE='
WHERE
key_id = '77669ba87e43eee6d3a6def51f5486ea1adde1bfa6704e619660e16961f8c61f'
AND (
token = '8lV+Z5eknnDn8lffdiZOnMV5zwhczaVZbWFZmsl/zQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)