UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qb+eJU514eJSCVPrAbZaXCU+E4uM8wpH85zzILLbO2Y='
WHERE
key_id = 'e337175a181cd4d4084bcb17896af356a6c49d0b5f894ffb4d9ffdc26110a89f'
AND (
token = 'Qb+eJU514eJSCVPrAbZaXCU+E4uM8wpH85zzILLbO2Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)