UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jWHpydmxywp+HmSV5wYn2a4DVeHnzfQiVijBJyO0AEE='
WHERE
key_id = '271ad1761b6b8f61d1295603ac5ae28cd37c2736dbb8f0e96f67b07ff6f6c361'
AND (
token = 'jWHpydmxywp+HmSV5wYn2a4DVeHnzfQiVijBJyO0AEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)