UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '100pUKnkfLFklO7CZ8Y6PuoVxKSIO01AYkURGnUuPjg='
WHERE
key_id = 'b8bd50e04b8cc51886e218bf872a5ce0d79c172c1668b70e348a695540e80a0f'
AND (
token = '100pUKnkfLFklO7CZ8Y6PuoVxKSIO01AYkURGnUuPjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)