UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ow3rqAstXcCcMbpS9ZXRAnKWhqxm62whUlrgAuWHFBg='
WHERE
key_id = 'ad028878d896a8c532ef750a38ace08135d4ad4e927b2fb3015a6984eb18ea99'
AND (
token = 'Ow3rqAstXcCcMbpS9ZXRAnKWhqxm62whUlrgAuWHFBg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)