UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q+0uQBzMuim5yjm3IhlY50pgMLdyGpFWXJs8ObhVYHY='
WHERE
key_id = '027d6a3091bec1eead1103a9bfe36ca7727573f5138edc17eca61301f7017c36'
AND (
token = 'q+0uQBzMuim5yjm3IhlY50pgMLdyGpFWXJs8ObhVYHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)