UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+nw10Xv2Szg5yW81HRw4RjCcsPRGhCrI7/mIXn0Hfvc='
WHERE
key_id = '6fc2e90888843adbbfee66db951b26fea561cf265f1f12b36c4b16075b5cfcc2'
AND (
token = '+nw10Xv2Szg5yW81HRw4RjCcsPRGhCrI7/mIXn0Hfvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)