UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '05ILcrTUME2vydgFt88Q0tfmhdAz/IoyHMt2dAOtfJI='
WHERE
key_id = '263f533db8ec9cc0ccb52221ff8eb88f760b298657ff4ffb16c49e367e1765ec'
AND (
token = '05ILcrTUME2vydgFt88Q0tfmhdAz/IoyHMt2dAOtfJI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)