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