UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jc02hENW2JvM7MQKelC7IuI45imgViZq/Tfc5gVasoI='
WHERE
key_id = '27d7b394dd4fb4c06f4a5630fd145b6ec2b380df345d0817aaa821e7b2ef7f25'
AND (
token = 'Jc02hENW2JvM7MQKelC7IuI45imgViZq/Tfc5gVasoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)