UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Y9pnCaKdWKsFHyXJ/a9kJ5tZImkZ6Pa2Hpy1tZ3ZLI='
WHERE
key_id = 'b25d845125ceb9dc295de3271603f5401b6b2d052bdd77f92ed5d35284e95ac9'
AND (
token = '9Y9pnCaKdWKsFHyXJ/a9kJ5tZImkZ6Pa2Hpy1tZ3ZLI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)