UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vD+c7hIJuiBp93XNUJjuz5EjxLQcfi5/VAcBTWwhf8g='
WHERE
key_id = 'ddec0a8ee5448171d538499eff52f62c03c57949b44a6b2d48cc1563cd2f5613'
AND (
token = 'vD+c7hIJuiBp93XNUJjuz5EjxLQcfi5/VAcBTWwhf8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)