UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GDbTY8sTOZmTBgaq572vhkrCWkyCkPRBxkTWBCJXRTI='
WHERE
key_id = '2d2753630e8bf494b3e5ac0d3f8a3b2ae7eda95ec61e5e2abaefc0865983e7e8'
AND (
token = 'GDbTY8sTOZmTBgaq572vhkrCWkyCkPRBxkTWBCJXRTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)