UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JNJtQxrIwM4r5KB4JfOoyBtgC9CsptK69/aZYubUdCQ='
WHERE
key_id = '4017faccf80a635a4539c8dd7ebe9c05ef5e7009cc4132abd3ed236a0bffc963'
AND (
token = 'JNJtQxrIwM4r5KB4JfOoyBtgC9CsptK69/aZYubUdCQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)