UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2OtYJhDhts7RgUhYsDaQloGrlAa7DL8JWG4WcERWUFc='
WHERE
key_id = '8ec5df48d064f6613fcf3a1f3251c436eda12a3159c8d5f6a963e793b8eaa018'
AND (
token = '2OtYJhDhts7RgUhYsDaQloGrlAa7DL8JWG4WcERWUFc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)