UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Td0gXhZq/4zg/77Kx7E8sfBQG6xKYnJPd8e9PVys4JY='
WHERE
key_id = 'b7980245caba74be203af4fc58a63ff9de0d868e4b6d1e778eafee482cbd2be1'
AND (
token = 'Td0gXhZq/4zg/77Kx7E8sfBQG6xKYnJPd8e9PVys4JY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)