UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UxgpzLNHmkyT+/poFi3udKXTx+hPVaG5bOrbB7mRf28='
WHERE
key_id = 'bed83a2ffc59c99dca30564e6d3c26432c6d9d2298240dec08bc0b1ddbee705a'
AND (
token = 'UxgpzLNHmkyT+/poFi3udKXTx+hPVaG5bOrbB7mRf28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)