UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5HtQ1ZMWXJn+6GT8flsVwZ/fk5cXfq6F0Vb1pRP1nDI='
WHERE
key_id = '02c7be73dd89d9507b6c7bf700b7b3c05e0a307117b42b7d9793ddbdf9e217a8'
AND (
token = '5HtQ1ZMWXJn+6GT8flsVwZ/fk5cXfq6F0Vb1pRP1nDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)