UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8dRojCuG6DdDolPjL+/c6ouO0JFSIfSEZb0U019Uf3c='
WHERE
key_id = 'ebb2a91f4951c12c741a3e34760124c9cc93af7b141bd969e5e9f2873f046c8b'
AND (
token = '8dRojCuG6DdDolPjL+/c6ouO0JFSIfSEZb0U019Uf3c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)