UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YqaitzUNI+yZhzO3d5tNdt8Qet4GgvRjAdGGvPx7vLs='
WHERE
key_id = 'e71c5dd6ff324367a42a076ffe39a86a672e0ac64b3c733a8d0c609ab7f12f41'
AND (
token = 'YqaitzUNI+yZhzO3d5tNdt8Qet4GgvRjAdGGvPx7vLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)