UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SDqL1PaOFvpH9QBiJ+4iSR/cR7m0VcBDJCB0AioWT0M='
WHERE
key_id = '22361a43847e0158078065f11f69e00784b1a6e76d455c4ed73a4be393e37eef'
AND (
token = 'SDqL1PaOFvpH9QBiJ+4iSR/cR7m0VcBDJCB0AioWT0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)