UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MEAPzoKEV7htQRUpwAg/Qx/414l/DJB86BAT+mLVNVU='
WHERE
key_id = '0ab58f8a13c5b95ae9262da93c7046059e2b29942460905cf52b2c662b0a2cf2'
AND (
token = 'MEAPzoKEV7htQRUpwAg/Qx/414l/DJB86BAT+mLVNVU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)