UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8jFRbFSPSS3sci7Hr4fefjt/8fvdia7xY6bYzbAOKHs='
WHERE
key_id = 'a2a93bdad83ed978cad6a187d554a978134729c15ccdfed45f30454a29d6f226'
AND (
token = '8jFRbFSPSS3sci7Hr4fefjt/8fvdia7xY6bYzbAOKHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)