UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YFhYjPUPOdvgZggMFmoc9kIzfo9RsyFwNJe1ykkIuHM='
WHERE
key_id = '823fb5b86bfbcd8d14df34e3ca6d251b29f9b32a13c2d49c0a209ba0ac60d9b4'
AND (
token = 'YFhYjPUPOdvgZggMFmoc9kIzfo9RsyFwNJe1ykkIuHM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)