UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q1KyX01Q198j0AGF94ftoSbC6XvhEep17ZkEevKXcHo='
WHERE
key_id = '2bd3c370dfbc61727e40574bed3b1fe65ad01d1f0c11bd6371c00fe170f02e44'
AND (
token = 'q1KyX01Q198j0AGF94ftoSbC6XvhEep17ZkEevKXcHo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)