UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+lRQ/Hif9gbRIdbG+zBhfEn5LMYi5R1Kjaw0gqCF/tQ='
WHERE
key_id = 'b0efe8fe03754dae1811fb4c4a386692a2ef34eb282b62209c9c556a9df9dc12'
AND (
token = '+lRQ/Hif9gbRIdbG+zBhfEn5LMYi5R1Kjaw0gqCF/tQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)