UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f97whPGB8jvT0sDX5l6MI67TcJPC81JVxyQnBkCgdDY='
WHERE
key_id = '4526aa470b517d49252bb977d321eeb75ce17d1cf73485ecc2ef7757e55b2a33'
AND (
token = 'f97whPGB8jvT0sDX5l6MI67TcJPC81JVxyQnBkCgdDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)