UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UmjiSwpTVjiglwLE98LY3FWCgf3vUDONuraGIbOrLtU='
WHERE
key_id = '19cf330d032ef25c57777d4b4ce134ca73a9732521b68e645f1a6a3464682b9d'
AND (
token = 'UmjiSwpTVjiglwLE98LY3FWCgf3vUDONuraGIbOrLtU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)