UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LzVlelXZJcsNMp97br76mZp3ZmzdAeknp8h3pPeZ9do='
WHERE
key_id = '46ec01d6028beb8268acb338c0c96f6e61bc02a80079d79feb422a945efac3fa'
AND (
token = 'LzVlelXZJcsNMp97br76mZp3ZmzdAeknp8h3pPeZ9do='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)