UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/xZM7rAz6/qM61VIzFdZ4r1XayK3EN1nI8QkxpHtmN4='
WHERE
key_id = '2bcacbbdb6c0b2f39a26dff1456070277ae15d0c6afe873c9457b98adcdb0c94'
AND (
token = '/xZM7rAz6/qM61VIzFdZ4r1XayK3EN1nI8QkxpHtmN4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)