UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jx/B59DhncDKgD9u2OM/9W0g2hLb9GTfl3C6cymr2Dk='
WHERE
key_id = '0f547c087dd85c79fc87a1f8839d44b09809ae732212c362882f2d8b5a7f87f1'
AND (
token = 'jx/B59DhncDKgD9u2OM/9W0g2hLb9GTfl3C6cymr2Dk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)